<template>
    <div class="republish-dialog-root">
        <div class="content">
            <p>{{messages[type]}}</p>
            <div class="button-group">
                <el-button @click="clickWhich(0)">取消</el-button>
                <el-button @click="clickWhich(1)">{{confirmText}}</el-button>
            </div>
        </div>
    </div>
</template>

<script>
  export default {
    name: 'RepublishDialog',
    props: {
      type: {
        type: Number,
        default: 0
      },
      messages: {
        type: Array,
        default() {
          return ['您的职位有效期已到，是否申请重新发布职位？', '您的试用期已到，暂无权限发布职位，请联系企业专属顾问重新发布职位']
        }
      }
    },
    computed: {
      confirmText() {
        if (this.type === 1) {
          return '联系顾问'
        } else {
          return '确定'
        }
      }
    },
    methods: {
      clickWhich(which) {
        this.$emit('click-which', this.type, which)
      }
    }
  }
</script>

<style lang="scss" scoped>
    .republish-dialog-root {
        .content {
            height: fit-content;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 40px 46px 40px 46px;
            /*border: 1px solid red;*/

            p {
                font-size: 24px;
                font-weight: 400;
                color: rgba(102, 102, 102, 1);
                line-height: 30px;
                text-align: center;
            }

            .button-group {
                display: flex;
                flex-direction: row;
                justify-content: space-around;
                margin-top: 42px;

                .el-button {
                    width: 155px;
                    height: 50px;
                    font-size: 24px;
                    font-weight: 400;

                    &:first-child {
                        border: 1px solid rgba(240, 147, 56, 1);
                        border-radius: 5px;
                        color: rgba(240, 147, 56, 1);
                    }

                    &:last-child {
                        background: rgba(240, 147, 56, 1);
                        border-radius: 5px;
                        color: rgba(255, 255, 255, 1);
                    }
                }

            }

        }
    }


</style>